<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>考卷评分</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<style type="text/css">
.test-one{
		height:30px;
		margin:10px auto;
		display: block;
		font-size:13px;
}
.statue{
		width:300px;
		height:30px;
		float:left;
		font-size:13px;
		margin-left:80px;
}
	.textbox-invalid,.validatebox-invalid{
		border:1px solid #CCCCCC;
		background-color: #fff;
		border-radius:4px;		
		height:24px;
		font-size:14px;
		line-height: 24px;
	}
.test-date{
		width:300px;
		height:30px;
		float:left; 
		margin-left: 20px;
}
.test-two{
		width:1100px;
		margin:auto;
}
#score{
		width: 100%;
		margin:auto;
	    overflow-x: auto;
	    margin-top: 5px;
	    border-collapse: collapse;
	    border: 1px solid #e4e7ec;
	    background-color: #fff;
   		color: gray;
   		font-size:12px; 
	}
	#score thead{
		color: #19AA8D;
	    font-size: 14px;
	    font-weight: 700;
	} 
	#score th{
		background: #6666661a;
	}
	#score td{
		border: 1px solid #e4e7ec;
		width: 150px;
		height: 50px;
	}
.datagrid-header-row td{
		background: #E6E6E6;
		color: #19AA9C;
	    font-size: 14px;
	    font-weight: 700;
	    text-align: center;
	}
	.datagrid-row td{
		background: #fff;
		font-size: 12px;
		text-align: center;
	}
.icon-hire-bianji{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/bianji.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
</style>
<script type="text/javascript">
function add(text){   
	$("#content-admin").panel({
		href:text
	})
}
function searchscore(){
	$("#score").datagrid({
	    url:'select-score',
		    columns:[[
		    	{field:'aa',checkbox:true,title:'选择',width:100},
		    	{field:'tmarkid',hidden:true,title:'编号',width:160},
		    	{field:'ttestid',hidden:true,title:'sefsdfdd',width:160},
		    	{field:'score',title:'序号',width:100},
		    	{field:'ks',title:'考生姓名',width:120},
		    	{field:'pf',title:'评分人',width:100},
		    	{field:'sname',title:'试卷名称',width:200},
		    	{field:'tmarkdate',title:'评分日期',width:330,align:'center',
		    		formatter:function(val,rec){
						return formattime(val);
			        }
		    	},
		    	{field:'caozuo',title:'操作',width:220,align:'center',
					formatter: function(value,row,index){
						return "<input type='button' class='bianji icon-hire-bianji' onclick='pigai("+row['ttestid']+")' style='width:80px;height: 20px;font-size:12px;color:#fff;background-color:#18A689;cursor: pointer;' value='批改'/>";
					}
					},
		    	]],		          
		         	pagination:true,
				    pageNumber:1,
				    pageSize:5,
				    pageList:[5,10,15]
		    });	
		}
		//根据名字查询
function chaxuns(value,name){
	$("#score").datagrid({
    queryParams:{
    	Staff_name:value
    },
    	url:'select-names',
    	columns:[[
    		{field:'aa',checkbox:true,title:'选择',width:100},
	    	{field:'tmarkid',hidden:true,title:'编号',width:160},
	    	{field:'ttestid',hidden:true,title:'sefsdfdd',width:160},
	    	{field:'score',title:'序号',width:100},
	    	{field:'ks',title:'考生姓名',width:120},
	    	{field:'pf',title:'评分人',width:100},
	    	{field:'ttestname',title:'试卷名称',width:200},
	    	{field:'tmarkdate',title:'评分日期',width:330,align:'center',
	    		formatter:function(val,rec){
					return formattime(val);
		        }
	    	},
	    	{field:'caozuo',title:'操作',width:220,align:'center',
				formatter: function(value,row,index){
					return "<input type='button' class='bianji icon-hire-bianji' onclick='pigai("+row['tmarkid']+")' style='width:80px;height:22px;font-size:12px;color:#fff;background-color:#18A689;cursor: pointer;border:none;' value='批改'/>";
				}
				},
	    	]],
	    	pagination:true,
		    pageNumber:1,
		    pageSize:5,
		    pageList:[5,10,15] 
	});
}  
$(function(){
	searchscore(null);
});
//搜索
function checkscore(value,name){   
	chaxuns(value,name);
	} 
	
	//点击批改按钮
	function pigai(id){
		$("#content-admin").panel({
			href:"scoretest?id="+id
		})
}
	//时间转换
	function formattime(value,row,index){
		var date = new Date(value);
		        var year = date.getFullYear().toString();
		        var month = (date.getMonth() + 1);
		        var day = date.getDate().toString();
		        var hour = date.getHours().toString();
		        var minutes = date.getMinutes().toString();
		        var seconds = date.getSeconds().toString();
		        if (month < 10) {
		            month = "0" + month;
		        }
		        if (day < 10) {
		            day = "0" + day;
		        }
		        if (hour < 10) {
		            hour = "0" + hour;
		        }
		        if (minutes < 10) {
		            minutes = "0" + minutes;
		        }
		        if (seconds < 10) {
		            seconds = "0" + seconds;
		        }
		        return year + "-" + month + "-" + day + " " + hour + ":" + minutes + ":" + seconds;
	}
</script>
	<div class="mytest">
		<div class="test-one">
		 <div class="statue">
		 <input type="hidden" id="ttestid">
			<input class="easyui-searchbox" searcher="checkscore" style="width:200px" data-options="prompt:'考生姓名'"></input>
			</div>
		</div>
		<div class="test-two">
			<table id="score" class="easyui-datagrid" data-options="width:1100,height:300">
			</table>
		</div>
 </div>
</body>
</html>